<?php

/**
 * Description of MainCss.
 *
 * @author Ian Clarence <ian.clarence@gmail.com>
 */
final class MainCss extends ViewResources {
    
    /**
     * The constructor. 
     */    
    public function __construct() {
        parent::__construct();
    }
    
    /**
     * Loading the CSS rules, and returning as an array.
     * 
     * @param array $viewFields
     * @return array
     */
    protected function resources($viewFields = array()) {               
        
        /**
         * Background colour. 
         */       
        $this->fields[] = ViewCssRule::cssInit( 
            'body',
            array(
                'position' => 'relative',
                'background-color' => StylesheetView::BACKGROUND_COLOUR, 
                'margin-top' => '0px'
            )
        );
        
        /**
         * Container (div id="container"): centre aligned with a given page width.
         */      
        $this->fields[] = ViewCssRule::cssInit(
            'div#container',
            array(
                'position' => 'relative', 
                'margin-top' => '0px',
                'margin-left' => 'auto',
                'margin-right' => 'auto',
                'width' => ViewUtils::px(StylesheetView::PAGE_WIDTH),
                'background-color' => StylesheetView::TEXT_BACKGROUND_COLOUR, 
                'height' => 'auto', 
                'min-height' => ViewUtils::px(StylesheetView::MIN_PAGE_HEIGHT),
                'font-family' => StylesheetView::FONT_FAMILY,
                'font-size' => ViewUtils::px(StylesheetView::FONT_SIZE),
                'color' => StylesheetView::TEXT_COLOUR
            )
        );    
        
        $this->fields[] = ViewCssRule::cssInit(
            'input',
            array(
                'background-color' => StylesheetView::TEXT_BACKGROUND_COLOUR, 
                'font-family' => StylesheetView::FONT_FAMILY,
                'font-size' => ViewUtils::em(StylesheetView::FONT_SIZE),
                'font-weight' => 'bold',
                'color' => StylesheetView::TEXT_COLOUR
            )
        );
        
        /**
         * Colouring the links, and removing underline. 
         */
        $this->fields[] = ViewCssRule::cssInit(
            'a',
            array(
                'color' => StylesheetView::LINK_COLOUR,
                'text-decoration' => 'none'
            )
        );
        
        /**
         * Hovering over links. 
         */
        $this->fields[] = ViewCssRule::cssInit(
            'a:hover',
            array(
                'color' => StylesheetView::HOVER_LINK_COLOUR
            )
        );
        
        /**
         * Making invisible anything with class 'hidden'. 
         */        
        $this->fields[] = ViewCssRule::cssInit(
            '.hidden',
            array(
                'display' => 'none'
            )
        );
        
        /**
         * Clearing floats left and right. 
         */        
        $this->fields[] = ViewCssRule::cssInit(
            'div#clear',
            array(
                'clear' => 'both'
            )
        );
        
        return $this->fields;
        
    }
    
}